//
//  SearchResultHeadView.m
//  ProjectsOne
//
//  Created by iOS开发 on 2018/7/11.
//  Copyright © 2018年 iOS开发. All rights reserved.
//

#import "SearchResultHeadView.h"

@implementation SearchResultHeadView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        _classLabel = [[UILabel alloc] init];
        _classLabel.font = [UIFont systemFontOfSize:17];
        _classLabel.textColor = [UIColor colorWithHexString:@"333333"];
        _classLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:_classLabel];
        
        [_classLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.centerY.mas_equalTo(self);
        }];
        
        UIImageView *leftImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"search_title_left"]];
        [self addSubview:leftImageView];
        
        [leftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(self.classLabel);
            make.right.mas_equalTo(self.classLabel.mas_left).with.offset(-10);
        }];
        
        UIImageView *rightImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"search_title_right"]];
        [self addSubview:rightImageView];
        
        [rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(self.classLabel);
            make.left.mas_equalTo(self.classLabel.mas_right).with.offset(10);
        }];
        
    }
    return self;
}

@end
